When taking the first ending in a piece of music that has a repeat in it, you play or sing right through the section marked "1" until you get to the repeat sign. Then go back to the beginning of the repeated passage.
Of course, on the next time through the repeated passage, you'll skip the first ending and play or sing the second ending, marked "2," and continue right through to its end. If there's yet another repeat sign at the end of that, you’ll go through a third time and take the third ending, marked "3," and so on — but not many pieces of music have more than two repeats and three endings!